package top.withwings.bonus.bonus.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import top.withwings.bonus.common.pojo.User;

import java.util.Date;
import java.util.List;

public class BonusForm {

    private int id;
    private User salesman;
    private Good good;
    private String batchNo;
    private double price;
    private double quantity;
    private double amount;
    private Date expiration;

    private List<Rate> singleRates;
    private Rate finalRate;
    private double makeUp; //补足
    private Date effectiveDate;//day
    private Date computedDate;//seconds


    private String remark;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public User getSalesman() {
        return salesman;
    }

    public void setSalesman(User salesman) {
        this.salesman = salesman;
    }

    public Good getGood() {
        return good;
    }

    public void setGood(Good good) {
        this.good = good;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getQuantity() {
        return quantity;
    }

    public void setQuantity(double quantity) {
        this.quantity = quantity;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public Date getExpiration() {
        return expiration;
    }

    public void setExpiration(Date expiration) {
        this.expiration = expiration;
    }

    public List<Rate> getSingleRates() {
        return singleRates;
    }

    public void setSingleRates(List<Rate> singleRates) {
        this.singleRates = singleRates;
    }

    public Rate getFinalRate() {
        return finalRate;
    }

    public void setFinalRate(Rate finalRate) {
        this.finalRate = finalRate;
    }

    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public Date getComputedDate() {
        return computedDate;
    }

    public void setComputedDate(Date computedDate) {
        this.computedDate = computedDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public double getMakeUp() {
        return makeUp;
    }

    public void setMakeUp(double makeUp) {
        this.makeUp = makeUp;
    }

    public double getBonusAmount() {
        return this.amount * (this.makeUp + this.finalRate.getValue());
    }

    public double getMakeUpAmount() {
        return this.amount * this.makeUp;
    }

    public void resetComputation() {
    }
}